package jsyf.oa.entity.contract;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.entity.device.DeviceDisplaceEntity;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Entity
@Table(name = "T_CON_REPLACEMENT", schema = "oa", catalog = "")
public class ReplacementEntity extends BaseEntity implements Serializable {

    private String mainId = "";
    private String replacementsName = "";
    private String description = "";
    private String totaldx = "";//置换价格的大写
    private String replacementsChineseName = "";//置换商品的中文名称
    private BigDecimal total = new BigDecimal("0.00");
    private List<DeviceDisplaceEntity> other;
    private List<DeviceDisplaceEntity> wjj;
    private List<DeviceDisplaceEntity> qiChe;
    private List<DeviceDisplaceEntity> fangWu;
    private List<DeviceDisplaceEntity> zzj;


    public String getReplacementsChineseName() {
        return replacementsChineseName;
    }

    public void setReplacementsChineseName(String replacementsChineseName) {
        this.replacementsChineseName = replacementsChineseName;
    }

    public String getTotaldx() {
        return totaldx;
    }

    public void setTotaldx(String totaldx) {
        this.totaldx = totaldx;
    }

    public List<DeviceDisplaceEntity> getOther() {
        return other;
    }

    public void setOther(List<DeviceDisplaceEntity> other) {
        this.other = other;
    }

    public BigDecimal getTotal() {
        return total;
    }

    public void setTotal(BigDecimal total) {
        this.total = total;
    }

    public String getMainId() {
        return mainId;
    }

    public void setMainId(String mainId) {
        this.mainId = mainId;
    }

    public String getReplacementsName() {
        return replacementsName;
    }

    public void setReplacementsName(String replacementsName) {
        this.replacementsName = replacementsName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public List<DeviceDisplaceEntity> getWjj() {
        return wjj;
    }

    public void setWjj(List<DeviceDisplaceEntity> wjj) {
        this.wjj = wjj;
    }

    public List<DeviceDisplaceEntity> getZzj() {
        return zzj;
    }

    public void setZzj(List<DeviceDisplaceEntity> zzj) {
        this.zzj = zzj;
    }

    public List<DeviceDisplaceEntity> getQiChe() {
        return qiChe;
    }

    public void setQiChe(List<DeviceDisplaceEntity> qiChe) {
        this.qiChe = qiChe;
    }

    public List<DeviceDisplaceEntity> getFangWu() {
        return fangWu;
    }

    public void setFangWu(List<DeviceDisplaceEntity> fangWu) {
        this.fangWu = fangWu;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject obj = new JSONObject();
        obj.put("ID", getId());
        obj.put("MAIN_ID", getMainId());
        obj.put("REPLACEMENTS_NAME", getReplacementsName());
        obj.put("DESCRIPTION", getDescription());
        obj.put("TOTAL", getTotal());
        obj.put("TOTALDX", this.getTotaldx());
        obj.put("REPLACEMENTS_CHINESE_NAME", this.getReplacementsChineseName());
        return obj;
    }

    @Override
    public String getTableName() {
        return "t_con_replacement";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject obj = new JSONObject();
        obj.put("ID", "id");
        obj.put("MAIN_ID", "mainId");
        obj.put("REPLACEMENTS_NAME", "replacementsName");
        obj.put("DESCRIPTION", "description");
        obj.put("TOTAL", "total");
        obj.put("TOTALDX", "totaldx");
        obj.put("REPLACEMENTS_CHINESE_NAME", "replacementsChineseName");
        return obj;
    }
}
